import java.util.Random;

public class Demo02 {

	public static void main(String[] args) {
		Random abc = new Random();
		
		int arr[] = new int [10];
		int ab [] = new int [2];
		for (int i = 0; i < arr.length; i++) {
			arr[i] = abc.nextInt(100);
		}
		index(arr,ab);
		for (int i = 0; i < 2; i++) {
			System.out.print(ab[i]+" ");
		}
		
	}
	
	public static int[] index (int arr[], int ab[]) {
		
		int max = arr[0];
		int min = arr[0];
		
		
		for (int i = 0; i < arr.length; i++) {
			if(arr[i] > max) {
				max = arr[i];
			}
			if(arr[i] < min) {
				min = arr[i];
			}
		}
		ab[0] = max;
		ab[1] = min;
		return ab;
	}
}
